﻿CREATE TABLE [dbo].[Employee_Attendance] (
    [Id]              INT             IDENTITY (1, 1) NOT FOR REPLICATION NOT NULL,
    [UserName]        NVARCHAR (50)   NULL,
    [EName]           NVARCHAR (50)   NULL,
    [CompanyId]       INT             NULL,
    [DepartmentId]    INT             NULL,
    [TypeId]          INT             NULL,
    [KouKuanAmount]   NUMERIC (18, 2) NULL,
    [KouKuanFromDate] DATETIME        NULL,
    [KouKuanToDate]   DATETIME        NULL,
    [Description]     NVARCHAR (1000) NULL,
    [CreateName]      NVARCHAR (50)   NULL,
    [CreateDate]      DATETIME        NULL,
    [Wage_FF]         INT             CONSTRAINT [DF_Employee_Attendance_Wage_FF] DEFAULT ((0)) NULL,
    [isFlag]          INT             CONSTRAINT [DF_Employee_Attendance_isFlag_1] DEFAULT ((0)) NULL,
    [Days]            FLOAT (53)      CONSTRAINT [DF_Employee_Attendance_Days_1] DEFAULT ((0)) NULL,
    [minute]          FLOAT (53)      CONSTRAINT [DF_Employee_Attendance_minute_1] DEFAULT ((0)) NULL,
    [m_flag]          INT             CONSTRAINT [DF_Employee_Attendance_m_flag_1] DEFAULT ((0)) NULL,
    [J_flag]          INT             CONSTRAINT [DF_Employee_Attendance_J_flag] DEFAULT ((0)) NULL,
    [t_flag]          INT             CONSTRAINT [DF_Employee_Attendance_t_flag_1] DEFAULT ((0)) NULL,
    [t_TypeName]      NVARCHAR (500)  CONSTRAINT [DF_Employee_Attendance_t_TypeName_1] DEFAULT ('') NULL,
    CONSTRAINT [PK_Employee_Attendance] PRIMARY KEY CLUSTERED ([Id] ASC)
);


GO
CREATE NONCLUSTERED INDEX [EFS_IX_Employee_Attendance_e62058f53a8f48048cf3ddb1e497af98]
    ON [dbo].[Employee_Attendance]([UserName] ASC, [KouKuanFromDate] ASC, [t_flag] ASC);


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'用于判断 该条数据是否进行过工资核算 未核算0，已核算1', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Employee_Attendance', @level2type = N'COLUMN', @level2name = N'Wage_FF';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'是否扣除满勤奖。0不扣，1扣', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Employee_Attendance', @level2type = N'COLUMN', @level2name = N'isFlag';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'请假天数', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Employee_Attendance', @level2type = N'COLUMN', @level2name = N'Days';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'迟到分钟数', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Employee_Attendance', @level2type = N'COLUMN', @level2name = N'minute';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'是否扣除满勤奖（0：不扣，1：扣）', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Employee_Attendance', @level2type = N'COLUMN', @level2name = N'm_flag';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'是否扣除绩效工资（0：不扣，1：扣）', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Employee_Attendance', @level2type = N'COLUMN', @level2name = N'J_flag';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'扣款类型（1:＜5次，未超过30分钟,2:＜5次，超过30分钟（不含30分钟）,3:≥5次，未超过30分钟,4:≥5次，超过30分钟（不含30分钟）,5:病假/事假,6:旷工,7:婚假/丧假/陪产假/流产假,8:整月产假,9:不足整月,10:入离职扣款,）', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Employee_Attendance', @level2type = N'COLUMN', @level2name = N't_flag';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'扣款类型（1:＜5次，未超过30分钟,2:＜5次，超过30分钟（不含30分钟）,3:≥5次，未超过30分钟,4:≥5次，超过30分钟（不含30分钟）,5:病假/事假,6:旷工,7:婚假/丧假/陪产假/流产假,8:整月产假,9:不足整月,10:入离职扣款,）', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Employee_Attendance', @level2type = N'COLUMN', @level2name = N't_TypeName';

